package hl.demosample.app.ext

import com.scwang.smart.refresh.layout.SmartRefreshLayout

/*
* path: DemoSample 
* Author: 86133
* Create: 2021-06-01 17:45
* Changes (from 2021-06-01)
* Desc:
*/

fun SmartRefreshLayout.refresh(refreshAction: () -> Unit = {}): SmartRefreshLayout {
    this.setOnRefreshListener {
        refreshAction.invoke()
    }
    return this
}

fun SmartRefreshLayout.loadMore(loadMoreAction: () -> Unit = {}): SmartRefreshLayout {
    this.setOnLoadMoreListener {
        loadMoreAction.invoke()
    }
    return this
}